<template>
  <view class="action-buttons-new">
    <button 
      v-if="!isLoggedIn"
      class="login-btn-new" 
      @click="handleLogin"
    >
      <text class="btn-icon">🚀</text>
      <text class="btn-text">立即登录</text>
    </button>
    <button 
      v-if="isLoggedIn"
      class="logout-btn" 
      @click="handleLogout"
    >
      <text class="btn-icon">👋</text>
      <text class="btn-text">退出登录</text>
    </button>
  </view>
</template>

<script>
export default {
  name: 'ActionButtons',
  props: {
    isLoggedIn: {
      type: Boolean,
      default: false
    }
  },
  methods: {
    handleLogin() {
      this.$emit('login')
    },
    handleLogout() {
      this.$emit('logout')
    }
  }
}
</script>

<style scoped>
/* ========== 操作按钮 - 全新设计 ========== */
.action-buttons-new {
  padding: 20rpx 0;
}

.login-btn-new,
.logout-btn {
  width: 100%;
  border-radius: 20rpx;
  padding: 28rpx;
  font-size: 28rpx;
  font-weight: bold;
  border: none;
  box-shadow: 0 6rpx 20rpx rgba(0, 0, 0, 0.1);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12rpx;
}

.login-btn-new {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.logout-btn {
  background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
  color: white;
}

.login-btn-new:active,
.logout-btn:active {
  transform: translateY(-4rpx);
  box-shadow: 0 10rpx 28rpx rgba(0, 0, 0, 0.15);
}

.btn-icon {
  font-size: 32rpx;
  filter: drop-shadow(0 2rpx 4rpx rgba(0, 0, 0, 0.2));
}

.btn-text {
  font-size: 28rpx;
  font-weight: bold;
  letter-spacing: 1rpx;
}
</style>

